package com.ardf.service.impl;

import com.ardf.entity.Details;
import com.ardf.mapper.DetailsMapper;
import com.ardf.service.IDetailsService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ShiYunHao
 * @since 2025-01-06
 */
@Service
public class DetailsServiceImpl extends ServiceImpl<DetailsMapper, Details> implements IDetailsService {


    @Resource
    private DetailsMapper detailsMapper;

    @Override
    public void saveAll(List<Details> list){
        detailsMapper.insert(list);
    }

    @Override
    public List<Details> selectByGId(Long gradeId) {

        return detailsMapper.selectList(new LambdaQueryWrapper<Details>().eq(Details::getGradeId,gradeId).orderByAsc(Details::getOrder));
    }

}
